//
//  ShareItemView.m
//  OnionHome
//
//  Created by fengjie on 2019/9/13.
//  Copyright © 2019 FengJie. All rights reserved.
//

#import "ShareItemView.h"
#import "MBProgressHUD.h"

@implementation ShareItemView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
    }
    return self;
}
-(void)createUI{
    NSArray * array = @[@"login_wx",@"login_qq",@"login_wb"];
    NSInteger x = 0;
    NSInteger with = 48;
    NSInteger spacing = (KScreenWidth - 45 * 2 - with * 3)/2;
    
    for (NSInteger i = 0 ; i < array.count; i++) {
        UIImageView * imageView = [[UIImageView alloc] initWithImage:IMAGE_NAMED(array[i])];
        imageView.layer.cornerRadius = 24;
        imageView.tag = i;
        imageView.userInteractionEnabled = YES;
        
        [imageView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)]];
        
        [self addSubview:imageView];
        
        x = spacing * i + with * i;
        
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(x);
            make.width.height.mas_equalTo(with);
            make.top.bottom.mas_equalTo(0);
        }];
        
    }
}
-(void)tapAction:(UITapGestureRecognizer *)tap{
     [UserModelManager goToLogin];
//    HUDNormal(@"敬请期待");
//    BlockSafeRun(self.tapBlock,tap.view.tag);
}
@end
